package com.zha;



import java.sql.*;

public class Phoenix {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        //连接驱动
        Class.forName("org.apache.phoenix.jdbc.PhoenixDriver");
        //得到连接对象
        Connection connection = DriverManager.getConnection("jdbc:phoenix:hbase:2181");

       //sql语句 查询表的所有
        String sql = "select * from persion";
        //根据连接对象得到发送器
        PreparedStatement statement = connection.prepareStatement(sql);
        //开始发送
        ResultSet resultSet = statement.executeQuery();
        //条件，找出name那一列的
        while (resultSet.next()){
            System.out.println(resultSet.getString("NAME"));
        }
        statement.close();
        connection.close();
    }

    }

